home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / FORTRAN Demo Projects / Absoft MacFortran II 3.2 Demos / TutorialAF.f < prev    next >
Text File  |  1993-07-08  |  2KB  |  68 lines

  1. C NOTE: Read the "MPW Fortrans" section of "About Compilers"
  2. C before compiling AF programs that use FaceWare modules.
  3.  
  4. C Tutorial AF Demonstration Program
  5. C ©FaceWare 1993.  All Rights Reserved.
  6.  
  7.     GLOBAL DEFINE
  8.     include "Types.inc"
  9.     include "QuickDraw.inc"
  10.     include "Controls.inc"
  11.     include "Events.inc"
  12.     include "OSUtils.inc"
  13.     include "OSEvents.inc"
  14.     include "SegLoad.inc"
  15.     include "Files.inc"
  16.     include "Resources.inc"
  17.     include "FaceStorAF.inc"
  18.     END
  19.  
  20.     include "FaceProcAF.inc"
  21.  
  22.       PROGRAM TutorialAF
  23.     implicit none
  24.       record /FaceRec/ fRec
  25.       common/FaceStuff/fRec
  26.     integer*2 theFlag,theListItem,theMenuItem
  27.     character*32 theString
  28.  
  29.       fRec.uName = 'Tutorial.Rsrc'
  30.       call FaceIt(0,DoInit,0,0,0,0)
  31.     theFlag = 0
  32.     theListItem = 3
  33.     theMenuItem = 2
  34.     theString = 'Hello'
  35.  
  36.       do while (.true.)
  37.         call FaceIt(0,DoLoop,0,0,0,0)
  38.       if ((fRec.uMenuID == 105).and.(fRec.uMenuItem == 1)) then
  39.         call FaceIt(0,NewWnd,1010,0,0,0)
  40.         call FaceIt(0,GetCtl,1010,0,1,3)
  41.         call FaceIt(0,LnkCtl,fRec.cControl,%loc(theFlag),2,0)
  42.         call FaceIt(0,GetCtl,1010,0,1,4)
  43.         call FaceIt(0,LnkCtl,fRec.cControl,%loc(theString),-31,0)
  44.         call FaceIt(0,GetCtl,1010,0,1,5)
  45.         call FaceIt(0,LnkCtl,fRec.cControl,%loc(theListItem),2,0)
  46.         call FaceIt(0,GetCtl,1010,0,1,6)
  47.         call FaceIt(0,LnkCtl,fRec.cControl,%loc(theMenuItem),2,0)
  48.         call FaceIt(0,SetVal,1010,0,0,0)
  49.         do while (.true.)
  50.           call FaceIt(0,MdlWnd,1010,0,0,0)
  51.         if (fRec.uMenuID == 1010) then
  52.           if (fRec.wcHit == -1) then
  53.             exit
  54.           else if (fRec.wcHit == 1) then
  55.             call FaceIt(0,GetVal,1010,0,0,0)
  56.             exit
  57.           else if (fRec.wcHit == 2) then
  58.             call FaceIt(0,GetCtl,1010,0,1,8)
  59.             fRec.uString = 'Run button was hit.'
  60.             call FaceIt(fRec.cControl,1565,2,0,0,0)
  61.           end if
  62.         end if
  63.         end do
  64.         call FaceIt(0,EndWnd,1010,0,0,0)
  65.       end if
  66.     end do
  67.     end
  68.